﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using ESOL.Common.Entity;

namespace ESOL.Common.Entity
{
    [DataContract]
    public class SupplierQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string SupplierName { set; get; }
        [DataMember]
        public string SupplierCode { set; get; }
        [DataMember]
        public string SupplierType { set; get; }
        [DataMember]
        public DateTime CreatedDate { set; get; }
        [DataMember]
        public DateTime CreatedDateTo { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class SupplierQueryPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<MstSupplierEntity> Supplieres { set; get; }
    }

    [DataContract]
    public class AppQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string AppNo { set; get; }
        [DataMember]
        public string PurchaseType { set; get; }
        [DataMember]
        public string AppPerson { set; get; }
        [DataMember]
        public DateTime AppDateFrom { set; get; }
        [DataMember]
        public DateTime AppDateTo { set; get; }
        [DataMember]
        public string RelatedType { set; get; }
        [DataMember]
        public string RelatedNo { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class PurAppQueryPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<PurAppEntity> Apps { set; get; }
    }

    [DataContract]
    public class PurAppItemQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string PurAppId { set; get; }
        [DataMember]
        public string PurAppNo { set; get; }
        [DataMember]
        public string PurAppPerson { set; get; }
        [DataMember]
        public string PurAppItemStatus { set; get; }
        [DataMember]
        public DateTime RequiredDateFrom { set; get; }
        [DataMember]
        public DateTime RequiredDateTo { set; get; }
        [DataMember]
        public string PurMaterialId { set; get; }
        [DataMember]
        public string PurMaterialName { set; get; }
        [DataMember]
        public string PurPoStatus { set; get; }
    }

    [DataContract]
    public class PurMaintainAppItem
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string PurAppId { set; get; }
        [DataMember]
        public string PurAppNo { set; get; }
        [DataMember]
        public string ProductId { set; get; }
        [DataMember]
        public string ProductName { set; get; }
        [DataMember]
        public string ProductCode { set; get; }
        [DataMember]
        public decimal Qty { set; get; }
        [DataMember]
        public decimal CurStgQty { set; get; }
        [DataMember]
        public string Unit { set; get; }
        [DataMember]
        public decimal Price { set; get; }
        [DataMember]
        public decimal SubTotalPrice { set; get; }
        [DataMember]
        public DateTime RequiredDate { set; get; }
        [DataMember]
        public string Remark { set; get; }
        [DataMember]
        public string Status { set; get; }
        [DataMember]
        public int Selected { set; get; }
    }

    [DataContract]
    public class PurAppItemQueryPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<PurMaintainAppItem> AppItems { set; get; }
    }

    [DataContract]
    public class RfqQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string RfqNo { set; get; }
        [DataMember]
        public DateTime ReqQuDateFrom { set; get; }
        [DataMember]
        public DateTime ReqQuDateTo { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class PurRfqQueryPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<PurRfqEntity> rfqs { set; get; }
    }

    [DataContract]
    public class MergePurAppItemResult
    {
        [DataMember]
        public List<PurRfqItemEntity> rfqItems { set; get; }
        [DataMember]
        public List<PurRlAppiRfqiEntity> rels { set; get; }
    }

    [DataContract]
    public class QuQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string QuNo { set; get; }
        [DataMember]
        public string RfqNo { set; get; }
        [DataMember]
        public string SupplierId { set; get; }
        [DataMember]
        public string SupplierName { set; get; }
        [DataMember]
        public DateTime QuDateFrom { set; get; }
        [DataMember]
        public DateTime QuDateTo { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class QuQueryPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<PurQuotationEntity> Qus { set; get; }
    }

    [DataContract]
    public class TransPurAppItemResult
    {
        [DataMember]
        public List<PurPoItemEntity> items { set; get; }
        [DataMember]
        public List<PurRlAppiPoiEntity> rels { set; get; }
    }

    [DataContract]
    public class PoQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string QuNo { set; get; }
        [DataMember]
        public string PoNo { set; get; }
        [DataMember]
        public string PurchaseType { set; get; }
        [DataMember]
        public string SupplierId { set; get; }
        [DataMember]
        public string SupplierName { set; get; }
        [DataMember]
        public string MaterialId { set; get; }
        [DataMember]
        public string MaterialName { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class PoQueryPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<PurPoEntity> Pos { set; get; }
    }

    [DataContract]
    public class TransPurPoResult
    {
        [DataMember]
        public PurArvEntity arv { set; get; }
        [DataMember]
        public List<PurArvItemEntity> items { set; get; }
    }

    [DataContract]
    public class PurArvQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string ArvNo { set; get; }
        [DataMember]
        public string PoNo { set; get; }
        [DataMember]
        public string SupplierId { set; get; }
        [DataMember]
        public string SupplierName { set; get; }
        [DataMember]
        public string MaterialId { set; get; }
        [DataMember]
        public string MaterialName { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class PurArvQueryPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<PurArvEntity> Arvs { set; get; }
    }

    //采购退货单
    [DataContract]
    public class PurRoSaveParam
    {
        [DataMember]
        public string curUserNo { set; get; }
        [DataMember]
        public PurRoEntity ro { set; get; }
        [DataMember]
        public List<PurRoItemDto> addItems { set; get; }
        [DataMember]
        public List<PurRoItemDto> updatedItems { set; get; }
        [DataMember]
        public List<PurRoItemDto> delItems { set; get; }
    }

    [DataContract]
    public class PurRoQueryCondition
    {
        [DataMember]
        public string curUserId { set; get; }
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }

        [DataMember]
        public string RoNo { set; get; }
        [DataMember]
        public string PurPoNo { set; get; }
        [DataMember]
        public string PurArvNo { set; get; }
        [DataMember]
        public string SupplierId { set; get; }
        [DataMember]
        public string SupplierName { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string Status { set; get; }

    }

    [DataContract]
    public class PurRoPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<PurRoEntity> ReturnOrders { set; get; }
    }

    [DataContract]
    public class PurRoItemDto
    {
        [DataMember]
        public string Id { set; get; }

        [DataMember]
        public string RoId { set; get; }

        [DataMember]
        public string RoNo { set; get; }

        [DataMember]
        public string MaterialId { set; get; }

        [DataMember]
        public string MaterialName { set; get; }

        [DataMember]
        public string MaterialCode { set; get; }

        [DataMember]
        public decimal Qty { set; get; }

        [DataMember]
        public string Unit { set; get; }

        [DataMember]
        public decimal Price { set; get; }

        [DataMember]
        public decimal SubTotal { set; get; }

        [DataMember]
        public string Reason { set; get; }

        [DataMember]
        public int IsFree { set; get; }

        [DataMember]
        public string Remark { set; get; }

        [DataMember]
        public decimal ArvQty { set; get; }
        [DataMember]
        public decimal InvInQty { set; get; }

    }

    [DataContract]
    public class PurPoItemQueryCondition
    {
        [DataMember]
        public string curUserId { set; get; }
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }

        [DataMember]
        public string poNo { set; get; }
        [DataMember]
        public string MaterialId { set; get; }
        [DataMember]
        public string MaterialName { set; get; }
        [DataMember]
        public string poStatus { set; get; }

    }

    [DataContract]
    public class PurPoItemDto:PurPoItemEntity
    {
        [DataMember]
        public int SelectedFlag { set; get; }
    }

    [DataContract]
    public class PurPoItemPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<PurPoItemDto> PoItemsDto { set; get; }
    }

    //供应商汇总信息
    [DataContract]
    public class PurSupplierSummaryDto : MstSupplierEntity
    {
        [DataMember]
        public int PoCount { set; get; }
        [DataMember]
        public int UnclosedPoCount { set; get; }
        [DataMember]
        public decimal PoTotalAmount { set; get; }//采购总金额
        [DataMember]
        public decimal InputAmount { set; get; }//入库金额
        [DataMember]
        public decimal PaymentsMade { set; get; }//已付款金额
        [DataMember]
        public decimal AmountDue { set; get; }//未付款金额
        [DataMember]
        public decimal InvoiceAmount { set; get; }//开票金额
        [DataMember]
        public decimal UninvoiceAmount { set; get; }//未开票金额
    }

    [DataContract]
    public class PurSupplierSummeryPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<PurSupplierSummaryDto> SummaryDto { set; get; }
    }

    //供应商业务清单
    [DataContract]
    public class PurBusinessListQueryCondition
    {
        [DataMember]
        public string curUserId { set; get; }
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }

        [DataMember]
        public string SupplierNo { set; get; }
        [DataMember]
        public string PoNo { set; get; }
        [DataMember]
        public string QuNo { set; get; }
        [DataMember]
        public string ItemCode { set; get; }
        [DataMember]
        public string PurchaseType { set; get; }
        [DataMember]
        public DateTime poDate { set; get; }
        [DataMember]
        public DateTime poDateTo { set; get; }
        [DataMember]
        public DateTime DeliveryDate { set; get; }
        [DataMember]
        public DateTime DeliveryDateTo { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string poStatus { set; get; }
    }

    [DataContract]
    public class PurBusinessListDto : PurPoItemDto
    {
        [DataMember]
        public string QuNo { set; get; }
        [DataMember]
        public string ContactPerson { set; get; }
        [DataMember]
        public string ContactTel { set; get; }
    }

      [DataContract]
    public class PurBusinessListDtoPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<PurBusinessListDto> BusinessListDto { set; get; }
    }

}
